-
Notifications
You must be signed in to change notification settings - Fork 143
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Potential bug?] Update spatial_relationships_exercises.rst #139
base: master
Are you sure you want to change the base?
Conversation
Using a subquery or a MULTILINESTRING instead of the suggested MULTILINESTRING->LINESTRING simplification gives different and expected results. There seems to be a difference between multilinestring and linestring having the same coordinates!
📝 WalkthroughWalkthroughThe changes update the SQL query in the Changes
Sequence Diagram(s)sequenceDiagram
participant U as User
participant Q as Query Engine
participant DB as nyc_streets Table
U->>Q: Execute spatial_relationship query
Q->>DB: Run subquery to fetch 'Atlantic Commons' geometry
DB-->>Q: Return geometry data
Q->>Q: Substitute geometry in the main query
Q-->>U: Return query results based on dynamic geometry
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (2)
postgis-intro/sources/en/spatial_relationships_exercises.rst (2)
86-88
: Dynamic Geometry Retrieval with Subquery
Replacing the hardcoded geometry with a subquery is a neat improvement for maintainability and correctness. However, please verify that the subquery returns exactly one row. If there is any chance of duplicate entries for 'Atlantic Commons', consider adding a clause (for example,LIMIT 1
or a unique identifier filter) to ensure only one geometry is retrieved.
92-97
: Review Sample Output Inclusion of 'Atlantic Commons'
The sample output for the "What streets does Atlantic Commons join with?" exercise includes "Atlantic Commons" itself. Given the PR discussion questioning whether the street should be excluded from its own join results, please confirm if this behavior is intentional. If the intention is to list only joining streets other than 'Atlantic Commons', you may need to adjust the query accordingly (for example, by adding a condition to filter out that name).
Using a subquery instead of a string MULTILINESTRING or LINESTRING gives different and more accurate results.
The exercise asks for the following question :
What streets does Atlantic Commons join with?
There seems to be a difference between raw geometry format and back/forth serialization! Maybe it is related to the SRID aspects ?
Using multilinestring or subquery :

Using suggested parsed linestring :

Also, for completion purpose, shouldn't the question be answered excluding the street itself (atlantic commons) ?